<?php
class ClsNaanalDownload
{
    public function __construct()
    {
        
    }
    public static function &getInstance()
    {
        static $objDownload=null;
        if(is_null($objDownload))
        {
            $objDownload=new ClsNaanalDownload();
        }
        return $objDownload;
    }
    function download($file,$mime='application/force-download')
    {
        header('Pragma: public'); 	
        header('Expires: 0');		
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Cache-Control: private',false);
        header('Content-Type: '.$mime);
        header('Content-Disposition: attachment; filename="'.basename($file).'"');
        header('Content-Transfer-Encoding: binary');
        header('Connection: close');
        readfile($file);	
        exit();
    }
}
?>